<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head th:include="common/common :: jscss">
    <title>试点配置/城市配置</title>
</head>
<body>

<div class="layui-fluid">

    <blockquote class="layui-crumb">
        试点配置/城市配置
    </blockquote>

    <div class="layui-card">

        <div class="layui-tab layui-tab-brief">
            <ul class="layui-tab-title">
                <li class="layui-this"><a th:href="|/pilot/city/toEdit.action?relationId=${item.relationId}|"
                                          lay-text="配置信息">基本信息</a></li>
                <li th:if="${item.relationId > 0  && isDetail == null }"><a
                        th:href="|/pilot/channel/price/serviceCategory.action?configId=${item.relationId}&type=2&showType=2|"
                        lay-text="应用分类">应用分类</a></li>
            </ul>
        </div>

        <div class="layui-split">&nbsp;</div>

        <form method="post" action="" class="layui-form" lay-filter="zmn-oneprice-city-form">
            <input type="hidden" name="relationId" id="relationId" th:value="${item.relationId}"/>
            <div class="layui-card-header" style="margin-top:10px;"><b></b></div>
            <div class="layui-split">&nbsp;</div>
            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">试点类型</label>
                <div class="layui-input-block" style="width: 50%;">
                    <select name="type" id="type" lay-verify="required" disabled="disabled" lay-search>
                        <option value="">请选择</option>
                        <option th:each="type:${typeList}" th:value="${type.key}"
                                th:text="${type.value}"
                                th:selected="${type.key == item.type}"/>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label layui-form-required">执行城市</label>
                <div class="layui-input-inline">
                    <select name="provinceId" id="provinceId" lay-filter="provinceId" lay-search
                            th:disabled="${isDetail}">
                        <option value="0"></option>
                        <option th:each="province:${provinces}" th:value="${province.value}"
                                th:text="${province.text}"/>
                    </select>
                </div>
                <div class="layui-input-inline">
                    <select name="cityId" id="cityId" lay-filter="cityId" lay-search th:disabled="${isDetail}">
                        <option value="0"></option>
                    </select>
                </div>
                <a href="#" class="layui-btn" id="addCity" th:if="${isDetail == null}">添加</a>
                <span style="color: #9F9F9F; padding-left: 5px">城市支持选择多个</span>
            </div>
            <div class="layui-form-item layui-form-required">
                <label class="layui-form-label"></label>
                <div class="layui-input-block" style="width: 50%;">
                    <div style="min-height: 100px;border: 1px solid #ccc;padding: 10px;" id="addCityDiv"></div>
                </div>
            </div>

            <zmn th:if="${item.type == 1}">
                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">选择支付方式</label>
                    <div class="layui-input-block">
                        <input th:each="payType,payTypeStat:${payTypeList}" type="radio" name="payType"
                               th:value="${payType.key}" th:checked="${payType.key == item.payType}"
                               th:disabled="${isDetail}"
                               th:title="${payType.value}" lay-verify="payType"
                               lay-filter="payType">
                    </div>
                </div>

                <div id="setDeposit" style="display: none">
                    <div class="layui-form-item">
                        <label class="layui-form-label layui-form-required">是否设置定金</label>
                        <div class="layui-input-block">
                            <input type="radio" th:each="deposit:${depositList}" name="depositStatus"
                                   th:disabled="${isDetail}"
                                   lay-filter="depositStatus"
                                   th:value="${deposit.key}" th:title="${deposit.value}"
                                   lay-verify="required" th:checked="${deposit.key} == ${item.depositStatus}">
                        </div>
                    </div>

                    <div id="depositBlock" style="display: none">
                        <div class="layui-form-item">
                            <label class="layui-form-label">定金</label>
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input" name="deposit" id="deposit"
                                       th:disabled="${isDetail}"
                                       placeholder="请输入正整数，100以内" lay-verify="maxSix"
                                       title="设置定金">
                            </div>
                            <span> 元 <span style="color: #9F9F9F;"> 如不设置定金执行支付原价</span></span>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label layui-form-required">是否设置定金抵扣</label>
                            <div class="layui-input-block">
                                <input type="radio" th:each="deposit:${depositList}" name="depositDeductionStatus"
                                       lay-filter="depositDeductionStatus" th:value="${deposit.key}"
                                       th:title="${deposit.value}"
                                       lay-verify="required"
                                       th:checked="${deposit.key == item.depositDeductionStatus}">
                            </div>
                        </div>
                        <div class="layui-form-item" th:hidden="${item.depositDeductionStatus!=2}" id="depositDeductionAmountBlock">
                            <label class="layui-form-label">定金抵扣金额</label>
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input" name="depositDeductionAmount" id="depositDeductionAmount"
                                       placeholder="请输入正整数"
                                       title="设置定金抵扣金额">
                            </div>
                            <span> 元 <span style="color: #9F9F9F;"> 如不设置则表示定金不能抵扣更多金额</span></span>
                        </div>
                    </div>
                </div>

            </zmn>
            <div class="layui-split">&nbsp;</div>
            <div class="layui-form-item layui-layout-admin">
                <div class="layui-input-block">
                    <div class="layui-footer" style="left: 0;text-align: left;padding-left: 25%;">
                        <button class="layui-btn" lay-submit="" lay-filter="zmn-oneprice-city-form-submit"
                                th:if="${isDetail == null}"
                                th:text="${item.relationId > 0? '提交' : '下一步' }">
                        </button>
                        <a class="layui-btn layui-btn-primary" th:if="${isDetail == null}"
                           onclick="zmnLayUtil.closeThisTabs()">取消</a>
                    </div>
                </div>
            </div>
        </form>
        <div class="layui-card" th:if="${isDetail}">
            <div class="layui-card-header" style="margin-top:10px;"><b>操作日志</b></div>
            <div class="layui-split">&nbsp;</div>
            <table class="layui-hide layui-table-cell" id="zmn-list-city-price-log-table"
                   lay-filter="zmn-channel-price-log-table"></table>
        </div>
    </div>
</div>
<script type="text/javascript" th:inline="javascript">

    var json = {
        item: [[${item}]],
        isDetail: [[${isDetail}]]
    };

    layui.config({
        base: "/static/lay/",
        version: 20190710
    }).extend({
        index: "lib/index",
        pilot_city_edit: "/pilot/city/zmn.plat.pilot.city.edit"
    }).use(['index', 'pilot_city_edit']);

</script>


</body>
</html>